<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Document</title>
    <link rel="stylesheet" href="../../../../../css/bootstrap.min.css" />
    <style>
        .page {
            height: 1010px;
            width: 100%;
            position: relative;
        }

        /*头部共用*/
        .share {
            width: 100%;
            margin-top: 15px;
        }

        .share > img {
            width: 20%;
            margin-left: 9%;
        }

        .share .share-right {
            width: 30%;
            float: right;
            margin-right: 52%;
            margin-bottom: 3%;
            margin-top: 4%;
            text-align: right;
            font-size: 24px;
            color: #666666;
            font-weight: 600;
        }

        .hr {
            width: 82%;
            height: 0px;
            background: #555555;
            margin: 15px auto;
        }

        .top2table {
            width: 82%;
            height: 30px;
            margin: 0px auto;
            font-size: 16px;
            color: #444444;
        }

        .ticon {
            width: 20px;
            display: inline-block;
            vertical-align: middle;
        }

        .tt {
            display: inline-block;
        }
        td{
            height: 40px;
            width: 100px;
        }
        .right {float: right;padding-right: 50px;}
    </style>
</head>
<body>
<div class="page">
    <input  id="reportId" type="hidden" name="reportId" th:value="${reportId}"/>
    <input  id="childId" type="hidden" name="childId" th:value="${childId}"/>
    <input  id="editFlag" type="hidden" name="editFlag" th:value="${editFlag}"/>
    <div class="share select-table table-striped">
        <div class="share-right"><span></span>测评报告</div>
        <table class="top2table">
            <tbody>
            <tr>
                <td align="right" style="font-weight:600;">姓名：</td>
                <td align="left">[[${reportTableDTO.name}]]</td>
                <td align="right" style="font-weight:600;">性别：</td>
                <td align="left">[[${reportTableDTO.sex}]]</td>
                <td align="right" style="font-weight:600;">年龄：</td>
                <td align="left">[[${reportTableDTO.age}]]</td>
                <td align="right" style="font-weight:600;">测评时间：</td>
                <td align="left">[[${reportTableDTO.evaluationTime}]]</td>
            </tr>
            </tbody>
        </table>
        <br/>
        <table border="1" style="border-collapse: collapse;width: 82%;margin: 0 auto;text-align: center;">
            <thead>
            <tr style="height: 50px">
                <th colspan="2" style="text-align: center">测评项目</th>
                <th style="text-align: center">测评结果</th>
            </tr>
            </thead>
            <tbody>
            <!-- 感觉统合 -->
            <tr>
                <td rowspan="3" th:text="${reportList[0].projectName}"></td>
                <td th:text="${reportList[0].speciesList[0].speciesName}"></td>
                <td th:text="${reportList[0].speciesList[0].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[0].speciesList[1].speciesName}"></td>
                <td th:text="${reportList[0].speciesList[1].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[0].speciesList[2].speciesName}"></td>
                <td th:text="${reportList[0].speciesList[2].result}"></td>
            </tr>
            <!-- 听知觉能力 -->
            <tr>
                <td rowspan="2" th:text="${reportList[1].projectName}"></td>
                <td th:text="${reportList[1].speciesList[0].speciesName}"></td>
                <td th:text="${reportList[1].speciesList[0].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[1].speciesList[1].speciesName}"></td>
                <td th:text="${reportList[1].speciesList[1].result}"></td>
            </tr>

            <!-- 视知觉能力 -->
            <tr>
                <td rowspan="4" th:text="${reportList[2].projectName}"></td>
                <td th:text="${reportList[2].speciesList[0].speciesName}"></td>
                <td th:text="${reportList[2].speciesList[0].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[2].speciesList[1].speciesName}"></td>
                <td th:text="${reportList[2].speciesList[1].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[2].speciesList[2].speciesName}"></td>
                <td th:text="${reportList[2].speciesList[2].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[2].speciesList[3].speciesName}"></td>
                <td th:text="${reportList[2].speciesList[3].result}"></td>
            </tr>
            <!-- 阅读理解能力 -->
            <tr>
                <td rowspan="5" th:text="${reportList[3].projectName}"></td>
                <td th:text="${reportList[3].speciesList[0].speciesName}"></td>
                <td th:text="${reportList[3].speciesList[0].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[3].speciesList[1].speciesName}"></td>
                <td th:text="${reportList[3].speciesList[1].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[3].speciesList[2].speciesName}"></td>
                <td th:text="${reportList[3].speciesList[2].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[3].speciesList[3].speciesName}"></td>
                <td th:text="${reportList[3].speciesList[3].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[3].speciesList[4].speciesName}"></td>
                <td th:text="${reportList[3].speciesList[4].result}"></td>
            </tr>
            <!-- 思维能力 -->

            <tr>
                <td rowspan="3" th:text="${reportList[4].projectName}"></td>
                <td th:text="${reportList[4].speciesList[0].speciesName}"></td>
                <td th:text="${reportList[4].speciesList[0].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[4].speciesList[1].speciesName}"></td>
                <td th:text="${reportList[4].speciesList[1].result}"></td>
            </tr>
            <tr>
                <td th:text="${reportList[4].speciesList[2].speciesName}"></td>
                <td th:text="${reportList[4].speciesList[2].result}"></td>
            </tr>
            </tbody>

        </table>
        <div style="margin-left: 45%;margin-top: 2%;margin-bottom: 2%">
            <a class="btn btn-success btn-xs" style="font-size: 18px;"  href="javascript:void(0)" onclick="printReport()"><i class="fa fa-search"></i>打印报告</a>
            <a id="editBtn" class="btn btn-primary btn-xs" style="font-size: 18px;display: none"  href="javascript:void(0)" onclick="updateReport()"><i class="fa fa-search"></i>编辑报告</a>
            <a class="btn btn-danger btn-xs" style="font-size: 18px;"  href="javascript:void(0)" onclick="closeItem()"><i class="fa fa-search"></i>关&nbsp;&nbsp;&nbsp;&nbsp;闭</a>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

    $(function () {
        if($("#editFlag").val()=="0"){
            $("#editBtn").hide();
        }else {
            $.ajax({
                url: ctx + "business/learningReport/edit/judge/" + $("#reportId").val(),
                type: "get",
                processData: false,
                contentType: false,
                success: function (result) {
                    if (result.statusCode == '0000' && result.edit == true) {
                        $("#editBtn").show();
                    }
                }
            })
        }


    });

    function printReport() {
        $.ajax({
            url: ctx + "business/learningReport/getReportPdfUrl/" + $("#reportId").val(),
            type: "get",
            processData: false,
            contentType: false,
            success: function (result) {
                if (result.statusCode == '0000') {
                    window.open(result.reportUrl)
                } else {
                    $.modal.alertWarning(result.msg);

                }
            }
        })
    }

    function updateReport() {
        var url = ctx + "business/childQuestion/editLearningEvaluate/"+$("#childId").val()+"/" + $("#reportId").val();
        $.modal.parentTab( "学能测评", url);
    }


</script>
</body>
</html>